define(['jquery','enhance-helper','domReady'],function($,enhanceHelper){'use strict';return function(widget){if(window.enhance_enable){$.widget('mage.sidebar',widget,{_removeItem:function(elem){let itemId=elem.data('cart-item');let data=this.getProductData(itemId);enhanceHelper.pushRemoveFromCart(data);return this._super(elem);},_updateItemQty:function(elem){let itemId=elem.data('cart-item');let data=this.getProductData(itemId);enhanceHelper.pushAddToCart(data);return this._super(elem);},getProductData:function(itemId){let product=this._getProductById(itemId);let itemSize;if($.isEmptyObject(product.options)){itemSize="";}else{itemSize=product.options['0']['value'];} let item_brand=window.localStorage.getItem(product.product_id+'_itemBrand_'+itemSize)??'BSG';let item_category=window.localStorage.getItem(product.product_id+'_itemCategory_'+itemSize)??'DEFAULT CATEGORY';let item_category2=window.localStorage.getItem(product.product_id+'_itemCategory2_'+itemSize)??'';let item_category3=window.localStorage.getItem(product.product_id+'_itemCategory3_'+itemSize)??'';let item_category4=window.localStorage.getItem(product.product_id+'_itemCategory4_'+itemSize)??'';let item_variant=window.localStorage.getItem(product.product_id+'_itemVariant_'+itemSize);let item_list_name=window.localStorage.getItem(product.product_id+'_itemListName_'+itemSize)??'minicart-list';let item_index=window.localStorage.getItem(product.product_id+'_itemIndex_'+itemSize);let data={};data.item_name=product.product_name;data.item_id=product.product_sku;data.price=product.product_price_value;data.item_brand=item_brand;data.item_category=item_category;data.item_category2=item_category2;data.item_category3=item_category3;data.item_category4=item_category4;data.item_variant=item_variant;data.item_variant2=itemSize;data.item_list_name=item_list_name;data.item_list_id=product.product_id;data.index=item_index;data.quantity=product.qty;return data;}});} return $.mage.sidebar;}});